/*
Vanessa Williamson
Proposal title: “The Taxpayer Gap”: Perceptions of the Taxpaying Population and Opposition to Welfare Spending


HYPOTHESES

Stated-Hyp1: those in T1 (low income people appear to pay nothing in net taxes - FIT condition) will express more opposition to welfare than control group

	Test-Hyp1: FIT condition vs. control will have greater opposition to welfare.

Stated-Hyp2: those in T2 (all income groups pay taxes - AT condition) will express less opposition to welfare than control group

	Test-Hyp2: AT condition vs. control will have lower opposition to welfare.

Stated-Hyp3: Low-income groups will be affected differently in both AT and FIT conditions.

	Test-Hyp3: Effect of FIT condition vs. control will be moderated by income.
	Test-Hyp4: Effect of AT condition vs. control will be moderated by income.

Stated-Hyp4: Republicans will be affected differently in both AT and FIT conditions.

	Test-Hyp5: Effect of FIT condition vs. control will be moderated by partisanship.
	Test-Hyp6: Effect of AT condition vs. control will be moderated by partisanship.
*/

clear all
use "Williamson859.dta", clear

********************************************************************************

* INDICATORS OF EXPERIMENTAL MANIPULATIONS

* Treatment group: income tax, all tax, control
	lab def treat 1 "Federal income tax (FIT)" 2 "All tax (AT)" 3 "Control" 
	clonevar treatment= GROUP
	lab val treatment treat
	tab treatment, mis

	
* OUTCOME MEASURES
	/* Should federal spending on the following be increased, decreased, 
	or kept about the same? */

* food stamps
	clonevar welfare_foodstamp = Q9A
	clonevar welfare_socsecurity = Q9B

	lab def welfare 1 "increased" 2 "same" 3 "decreased"
	* higher values show more negative attitudes towards welfare
	
	foreach var of varlist welfare* {
	replace `var'=. if `var'>3
	recode `var' (1=1) (2=3) (3=2)
	lab val `var' welfare
	tab `var'
	}
 	
* MODERATORS

* low-income
	/* author didn't define low-income.
	- defining based on bottom quintile of household
	income in survey year (2017): $24,827 household income
	https://www.census.gov/data/tables/time-series/demo/income-poverty/cps-hinc/hinc-05.2017.html
	*/
	recode INCOME (1/5=1) (5/18=0) (*=.), gen(lowincome)
	tab lowincome, mis
	
* Republican affiliation
	lab def republican 0 "Non-Republican" 1 "Republican"
	recode PID1 (1=0) (2=1) (3/4=0) (*=.), gen(republican)
	lab val republican republican
	tab republican, mis // only 371 republicans
	
********************************************************************************

* ANALYSIS
	

*TH1: those in T1 will express more opposition to welfare than control group
	reg welfare_foodstamp ib3.treatment if treatment!=2
		// reject 
	tess 1.treatment +, init(Williamson859)
		
*TH2: those in T2 will express less opposition to welfare than control group
	reg welfare_foodstamp ib3.treatment if treatment!=1
		// reject 
	tess 2.treatment -

*TH3: Effect of FIT condition vs. control will be moderated by income.
	reg welfare_foodstamp ib3.treatment##i.lowincome if treatment!=2
		// reject
	tess 1.treatment#1.lowincome
	
*TH4: Effect of AT condition vs. control will be moderated by income.
	reg welfare_foodstamp ib3.treatment##i.lowincome if treatment!=1
		// reject
	tess 2.treatment#1.lowincome
	
*TH5: Effect of FIT condition vs. control will be moderated by partisanship.
	reg welfare_foodstamp ib3.treatment##i.republican if treatment!=2
		// reject
	tess 1.treatment#1.republican
	
*TH6: Effect of AT condition vs. control will be moderated by partisanship.
	reg welfare_foodstamp ib3.treatment##i.republican if treatment!=1
		// reject
	tess 2.treatment#1.republican		
